import service from "@/service";
let app = {
  permissionCode: "LQXT",
  routerBase: "/nebula/asphalt-app",
};

//根据dickey查询该租户下数据
export function getDickeyList(data) {
  let { dictKey = "userType", extension1, module } = data;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/config-dict-data/getDataByDictKey`,
    method: "POST",
    data: {
      dictKey,
      extension1,
      module,
    },
  });
}

//新增该部门下字典数据
export function addData(data) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/config-dict-data/addData`,
    method: "POST",
    data: data,
  });
}

//根据用户登录id,租户id查询标段列表数据
export function getBlockList(parameter) {
  let { permissionCode } = app;
  let { userId, tenantCode } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/user/sys-org/getInfoByUserIdAndTenantCode?userId=${userId}&tenantCode=${tenantCode}`,
    method: "POST",
    data: {
      systemCode: permissionCode,
    },
  });
}

//查询字段列表
export function getField(parameter) {
  let { equCode, flag = "1", display = "1" } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/config-equ-fieldcfg/equFieldList`,
    method: "POST",
    data: { equCode, flag, display },
  });
}

//获取附件地址
export function getFilePathCommon(domain, id) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/${domain}/configFile/getFilePath?id=` + id,
    method: "GET",
  });
}

//查询拌和站列表数据
export function getMixinList(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/config-equ/getByCondition`,
    method: "POST",
    data: parameter,
  });
}

//查询桥梁列表数据
export function getBridgeList(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/queryBridgeName`,
    method: "GET",
    params: parameter,
  });
}

//查询桥号列表数据
export function getComponentPartList(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-zl/queryComponentPart`,
    method: "GET",
    params: parameter,
  });
}

//查询工程名称
export function queryEngineerName(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/queryEngineerName`,
    method: "GET",
    params: parameter,
  });
}

//查询浇筑部位
export function queryPlacePart(parameter) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/queryPlacePart`,
    method: "GET",
    params: parameter,
  });
}

//查询强度等级
export function getstrengthList(parameter) {
  let { equCode, secCode, projectName, placePart } = parameter;
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/sn-mp-data/queryStrengthGrade`,
    method: "GET",
    params: { equCode, secCode, projectName, placePart },
  });
}

//查询监测因子列表数据
export function getstructureList(params) {
  return service({
    baseUrl: "gateWaybaseUrl",
    url: `/beam/quality-hj-data/queryParam`,
    method: "GET",
    params,
  });
}
